package net.zjitc.dao;

import net.zjitc.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserDao {
//    @Insert("INSERT INTO users(username, age) VALUES(#{username}, #{age})")
//    void save(User user);
//    @Delete("DELETE FROM users WHERE id = #{id}")
//    void delete(Integer id);
//    @Update("UPDATE users SET username = #{username}, age = #{age} WHERE id = #{id}")
//    void update(User user);
    @Select("SELECT * FROM users")
    List<User> findAll();
//    @Select("SELECT * FROM users WHERE id = #{id}")
//    User findById(Integer id);
}
